package com.ebocy.hammer.battle.fight.message;

import java.util.List;

import com.ebocy.hammer.core.constants.GameMessageCode;
import com.ebocy.hammer.core.message.AbstractS2CMessage;

public class S2CCombatEndMessage extends AbstractS2CMessage {
	private List<BattleResutReport> battleResutReports;


	public S2CCombatEndMessage(List<BattleResutReport> battleResutReports) {
		super();
		this.battleResutReports = battleResutReports;
	}

	@Override
	protected void writeMessage() {
		writeByte((byte)battleResutReports.size());
		for (BattleResutReport report : battleResutReports) {
			writeString(report.playerId);
			writeShort(report.countOfKill);
			writeShort(report.countOfDizzy);
			writeShort(report.rewardExp);
			writeShort(report.rewardCoin);
			writeByte(report.isWin);
		}
	}

	@Override
	public short getMessageCode() {
		return GameMessageCode.BATTLE_COMBAT_END;
	}

}
